var timeHideFix;
function slideInfo(btn,content){
	var fromObjHeight=7;//距离对象的上方高度
	var objId="collectInfo";//弹出层id
	var rate=5;//层弹出滑动每次变化高度
	var height0=40;//层高
	var lineHeight0=40;//层行高
	var hide_time=2000;//层多长时间消失
	var bodyScrollHeight=Math.max(document.documentElement.scrollTop,document.body.scrollTop);
	/*设置弹框属性*/
    var obj=document.getElementById(objId);
    if(!obj) {
		obj=document.createElement("div");
		document.body.appendChild(obj);
	};	
	obj.id=objId;
	obj.innerHTML=content;
	obj.style.lineHeight=lineHeight0+"px";
	obj.style.right=document.body.offsetWidth-btn.getBoundingClientRect().left-btn.offsetWidth+"px";
	obj.style.top=btn.getBoundingClientRect().top+bodyScrollHeight-fromObjHeight+"px";
	obj.style.cssText+=';border:1px solid #B1C7E7;padding:0 10px;overflow:hidden;position:absolute;z-index:10;background:#EFF9FA;filter:Alpha(Opacity="100");color:#769FD4';;
    /**/
	clearTimeout(timeHideFix);
	var objHeight=height0;
    var h=0;
	var h1=objHeight;
	var ie=(navigator.appVersion.indexOf("MSIE")!=-1)? true:false;
	
	//隐藏
    var objHide=function(){
         h+=rate;
        if(h>=objHeight){
			obj.style.display="none";
        }else{
			ie? obj.filters.alpha.opacity=((objHeight-h)*100/objHeight):obj.style.opacity=(objHeight-h)/objHeight;
            setTimeout(objHide,1);
        }
    }
	//显示
    var objShow=function(){
		 h-=rate;
        if(h<-objHeight){
            obj.style.marginTop="-"+objHeight;
			timeHideFix=setTimeout(objHide,hide_time);
        }else{
            obj.style.marginTop=h+"px";
			obj.style.height=-h+"px";
			ie? obj.filters.alpha.opacity=((objHeight-h)*100/objHeight):obj.style.opacity=(objHeight-h)/objHeight;
            setTimeout(objShow,1);
        }
    }	
		
		obj.style.display="block";
		objShow();
}

/*转发*/
function slide_zhf(obj){
	slideInfo(obj,'复制成功，请按CTRL+V发送给好友、论坛或博客！');
	return false;
}
/*收藏*/
function slide_shc(obj){
	slideInfo(obj,'收藏成功！');	
	return false;
}

/*网辩*/
function slide_wb(obj){
	slideInfo(obj,'谢谢支持！');	
}


